﻿using System;

namespace 函数_方法_
{
    class Program
    {
        static void Main(string[] args)
        {
            //bool b = Run(2000);
            // Console.WriteLine(b);
            int a1 = 10;
            int a2 = 20;
            int Max = GetMax(a1, a2);//实参 实际的参数
            Console.WriteLine(Max);
            Console.ReadKey();
        }
        /// <summary>
        /// 判断给定的年份是否是闰年
        /// </summary>
        /// <param name="year">要判断的年份</param>
        /// <returns>是否是闰年</returns>
        public static bool Run(int year)
        {
            bool b = (year % 400 == 0) || (year % 4 == 0 && year % 100 != 0);
            return b;
        }
        
        /// <summary>
        /// 计算两个整数的最大值
        /// </summary>
        /// <param name="n1">值一</param>
        /// <param name="n2">值二</param>
        /// <returns>返回最大值</returns>
        public static int GetMax(int n1 ,int n2)//形参 形式上的参数，与实际没有关系
        {
          int Max =  n1 > n2 ? n1 : n2;
            return Max;
        }
    }
}
